<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程列表</title>
</head>
<body>
{#向course目录发送表单数据，会被urls.py接受#}
<form action="../major" style="margin: 10px 0">
    <input name="major" placeholder="请输入专业代码/专业名称" value="{{ major }}" style="margin-right: 10px"/>
    <button type="submit">查询</button>
</form>
    <table border="1px" width="100%" style="border-collapse: collapse;">
        <a href="../major/major_add">添加专业</a>
        <a href="../teacher/">教师管理</a>
        <a href="../course/">课程管理</a>
        <a href="../logout/">退出登录</a>
        <tr>
            <th>专业代码</th>
            <th>专业名称</th>
            <th>学历层次</th>
            <th>主考院校</th>
            <th>课程数量</th>
            <th>所属省份</th>
            <th>上线状态</th>
            <th>同类排序</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
    {#在model中index模块下传来了参数teachers#}
        {% for major in majors %}
            <tr>
    {#        forloop.counter用于在for循环里面获取当前循环次数#}
    {#            <td align="center">{{ forloop.counter }} </td>#}
                <td align="center">{{ major.id }} </td>
                <td align="center">{{ major.major }} </td>
                <td align="center">{{ major.level }} </td>
                <td align="center">{{ major.colleges }} </td>
                <td align="center">{{ major.course_num }} </td>
                <td align="center">{{ major.provice }} </td>
                <td align="center">{{ major.status }}</td>
                <td align="center">{{ major.sort }} </td>
                <td align="center">{{ major.update_time }}</td>
                <td align="center">
                    <a href="../major/major_edit/?id={{ major.id }}">
                        编辑
                    </a>
                    <a href="../major/major_delete/?id={{ major.id }}">
                        删除
                    </a>
                </td>
            </tr>
        {% endfor %}
    </table>
    <div>
        {{ pager_str|safe }}
    </div>
</body>
</html>